import React from 'react';
import { observer } from 'mobx-react-lite';
import { ThemeCustomizer } from '@/components/theme-customizer';
import { Label } from '@/components/ui/label';
import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group';
import appStore from '@/store/app';

const SettingsGeneralPage = observer(() => {
    return (
        <main>
            <div>
                <div>主题设置</div>
                <RadioGroup
                    onValueChange={(value) => appStore.setMenuPosition(value)}
                    defaultValue={appStore.menuPosition}
                    className='grid grid-cols-3 gap-4 mt-5'
                >
                    <div>
                        <RadioGroupItem value='light' id='light' className='peer sr-only' />
                        <Label
                            htmlFor='light'
                            className='flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary'
                        >
                            <svg
                                xmlns='http://www.w3.org/2000/svg'
                                viewBox='0 0 24 24'
                                fill='none'
                                stroke='currentColor'
                                strokeLinecap='round'
                                strokeLinejoin='round'
                                strokeWidth='2'
                                className='mb-3 h-6 w-6'
                            >
                                <rect width='20' height='14' x='2' y='5' rx='2' />
                                <path d='M2 10h20' />
                            </svg>
                            light
                        </Label>
                    </div>
                    <div>
                        <RadioGroupItem value='dark' id='dark' className='peer sr-only' />
                        <Label
                            htmlFor='dark'
                            className='flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary'
                        >
                            <svg role='img' viewBox='0 0 24 24' className='mb-3 h-6 w-6'>
                                <path
                                    d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'
                                    fill='currentColor'
                                />
                            </svg>
                            dark
                        </Label>
                    </div>
                    <div>
                        <RadioGroupItem value='system' id='system' className='peer sr-only' />
                        <Label
                            htmlFor='system'
                            className='flex flex-col items-center justify-between rounded-md border-2 border-muted bg-popover p-4 hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary'
                        >
                            <svg role='img' viewBox='0 0 24 24' className='mb-3 h-6 w-6'>
                                <path
                                    d='M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701'
                                    fill='currentColor'
                                />
                            </svg>
                            system
                        </Label>
                    </div>
                </RadioGroup>
            </div>
            <div className='mt-4'>
                <div>按钮主色</div>
                <ThemeCustomizer />
            </div>
            <div className='mt-4'>面包屑</div>
            <div className='mt-4'>页签</div>
        </main>
    );
});
SettingsGeneralPage.displayName = 'SettingsGeneralPage';
export default SettingsGeneralPage;
